package org.cms.nio.main;

import java.io.IOException;

import org.cms.nio.NIOReactorPool;
import org.cms.nio.NetSystem;
import org.cms.nio.bufferpool.SharedBufferPool;
import org.cms.nio.client.NIOConnector;

/**
 * @Description: 
 * @Department:
 * @author andy.lhc
 * @date 2016年6月2日 下午2:45:00 
 */
public class NIOClient {

  public static final int PORT = 9999;
  
  /**
   * @param args
   * @throws IOException 
   */
  public static void main(String[] args) throws IOException {
    
    SharedBufferPool sharedPool = new SharedBufferPool(1024 * 1024 * 100, 1024);
    new NetSystem(sharedPool) ;
    NIOReactorPool reactorPool = new NIOReactorPool("NIOClient_Reactor_Pool", 5, sharedPool);
    
    NIOConnector connector = new NIOConnector("NIOClient_Connector", reactorPool);
    connector.start();
    
    NetSystem.getInstance().setConnector(connector);
    
    
  }

}
